package com.taoym.voucher.xcx.controller;

import com.taoym.voucher.common.response.Response;
import com.taoym.voucher.xcx.entity.dto.XcxLoginDTO;
import com.taoym.voucher.xcx.entity.vo.XcxLoginVO;
import com.taoym.voucher.xcx.service.XcxService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @coder taoym
 * @datetime 2021/6/4 18:10
 * @desc 小程序控制器
 */
@RestController
@RequestMapping("/xcx")
@Api(tags = "小程序控制器")
public class XcxController {

    @Autowired
    private XcxService xcxService;

    @ApiOperation("小程序登录")
    @PostMapping("/login")
    public Response<XcxLoginVO> xcxLogin(@Valid @RequestBody XcxLoginDTO data) {
        return Response.success(xcxService.xcxLogin(data));
    }
}
